<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let obj1 = {
            name: 'Tom',
            age: 18,
            say() {
                console.log('周六上课么？');
            }
        }
        // obj1.say();
        let {
            name: n,
            age: a,
            say: ssr
        } = obj1;

        console.log(n);
        console.log(a);
        ssr()
        let {
            dir: fn1,
            log: fn2
        } = console;
        fn2(666);

        // 嵌套了好多层
        let objn = {
            name: 'Mabaoguo',
            kongFu: [
                {name: '耗子尾汁'},
                {name: '松果糖豆闪电五连鞭'},
                {name: '有备而来'},
                {name: '不讲武德'},
            ]
        }
        let {
            name, // name: name的缩写
            kongFu: [{name: nameA},f,g,h]
        } = objn;
        console.log(name);
        console.log(nameA);
        console.log(f);
    </script>
</body>

</html>